<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=0.45">

    <title>上海莱升信息科技有限公司</title>
    <link rel="stylesheet" href="css/style.css">
    <style>
        .header-description {
            font-size: 1.1rem;
            margin-top: 0.8rem;
            color: rgba(255, 255, 255, 0.9);
            max-width: 800px;
            margin-left: auto;
            margin-right: auto;
            line-height: 1.6;
        }
        .position-title {
            text-align: center;
            color: var(--primary-dark);
            margin-bottom: 2rem;
            font-size: 1.8rem;
            font-weight: 600;
            padding-bottom: 0.5rem;
            border-bottom: 2px solid var(--secondary-color);
            display: inline-block;
        }
        .title-container {
            text-align: center;
            margin-bottom: 2rem;
        }
        /* 岗位卡片容器样式 */
        .position-container {
            display: flex;
            justify-content: center;
            gap: 3rem;
            margin-top: 2rem;
            flex-wrap: wrap;
        }
        /* 岗位卡片样式 */
        .position-card {
            width: 300px;
            height: 200px;
            background: white;
            border-radius: 15px;
            box-shadow: 0 8px 25px rgba(0,0,0,0.1);
            overflow: hidden;
            cursor: pointer;
            transition: all 0.3s ease;
            text-decoration: none;
            display: flex;
            flex-direction: column;
            position: relative;
        }
        .position-card:hover {
            transform: translateY(-10px);
            box-shadow: 0 15px 35px rgba(0,0,0,0.15);
        }
        .position-image {
            width: 100%;
            height: 120px;
            background-size: cover;
            background-position: center;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 2.5rem;
            font-weight: bold;
        }
        .position-info {
            padding: 1rem;
            text-align: center;
            flex: 1;
            display: flex;
            flex-direction: column;
            justify-content: center;
        }
        .position-name {
            font-size: 1.3rem;
            font-weight: 600;
            color: var(--primary-dark);
            margin-bottom: 0.5rem;
        }
        .position-desc {
            font-size: 0.9rem;
            color: var(--text-light);
            line-height: 1.4;
        }
        /* 实施岗位图片背景 */
        .implementation-bg {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        /* 开发岗位图片背景 */
        .development-bg {
            background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
        }
        
        /* 响应式设计 */
        @media (max-width: 768px) {
            .position-container {
                flex-direction: column;
                align-items: center;
                gap: 2rem;
            }
            .position-card {
                width: 280px;
                height: 180px;
            }
            .position-image {
                height: 100px;
                font-size: 2rem;
            }
            .position-name {
                font-size: 1.2rem;
            }
            .position-desc {
                font-size: 0.85rem;
            }
        }
        /* 公司官网访问横幅样式 */
        .company-banner {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            z-index: 9999;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
            animation: slideDown 0.5s ease-out;
        }

        .banner-content {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 15px 20px;
            max-width: 1200px;
            margin: 0 auto;
        }

        .banner-icon {
            font-size: 24px;
            margin-right: 15px;
            animation: pulse 2s infinite;
        }

        .banner-text {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .banner-text strong {
            font-size: 16px;
            font-weight: 600;
        }

        .banner-text span {
            font-size: 14px;
            opacity: 0.9;
        }

        .banner-btn {
            background: rgba(255, 255, 255, 0.2);
            color: white;
            border: 2px solid rgba(255, 255, 255, 0.3);
            padding: 10px 20px;
            border-radius: 25px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 600;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 8px;
            margin: 0 15px;
            backdrop-filter: blur(10px);
        }

        .banner-btn:hover {
            background: rgba(255, 255, 255, 0.3);
            border-color: rgba(255, 255, 255, 0.5);
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
        }

        .banner-close {
            background: none;
            border: none;
            color: white;
            font-size: 24px;
            cursor: pointer;
            padding: 5px;
            border-radius: 50%;
            width: 35px;
            height: 35px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
        }

        .banner-close:hover {
            background: rgba(255, 255, 255, 0.2);
        }

        /* 动画效果 */
        @keyframes slideDown {
            from {
                transform: translateY(-100%);
                opacity: 0;
            }
            to {
                transform: translateY(0);
                opacity: 1;
            }
        }

        @keyframes slideUp {
            from {
                transform: translateY(0);
                opacity: 1;
            }
            to {
                transform: translateY(-100%);
                opacity: 0;
            }
        }

        @keyframes pulse {
            0%, 100% {
                transform: scale(1);
            }
            50% {
                transform: scale(1.1);
            }
        }

        /* 当横幅显示时，调整页面内容位置 */
        body.has-banner {
            padding-top: 80px;
        }

        /* 响应式设计 */
        @media (max-width: 768px) {
            .banner-content {
                flex-direction: column;
                gap: 10px;
                text-align: center;
            }
            
            .banner-text {
                order: 2;
            }
            
            .banner-btn {
                order: 3;
                margin: 0;
            }
            
            .banner-close {
                order: 1;
                align-self: flex-end;
            }
        }
    </style>
</head>
<body>
    <!-- 公司官网访问提示横幅 -->
    <div class="company-banner" id="companyBanner">
        <div class="banner-content">
            <div class="banner-icon">🏢</div>
            <div class="banner-text">
                <strong>欢迎访问上海莱升信息科技有限公司官网！</strong>
                <span>了解更多公司信息、企业文化和发展机会</span>
            </div>
            <button class="banner-btn" onclick="visitCompanyWebsite()">
                <span class="btn-icon">🌐</span>
                访问公司官网
            </button>
            <button class="banner-close" onclick="closeBanner()">×</button>
        </div>
    </div>

    <header class="header">
        <h1>上海莱升信息科技有限公司面试系统</h1>
        <p class="header-description">欢迎使用面试系统，本系统旨在帮助您快速提交面试申请并完成相关考核。请选择以下岗位进行申请，我们将尽快处理您的信息。</p>
        <p class="header-description">注:您面试完之后可以在24小时之内登录公司面试系统删除您的个人信息</p>
    </header>
    <main class="main-content">
        <div class="title-container">
            <h2 class="position-title">面试岗位</h2>
        </div>
        <div class="position-container">
            <a href="accounting-form.html" class="position-card">
                <div class="position-image implementation-bg">
                    📊
                </div>
                <div class="position-info">
                    <div class="position-name">实施岗位</div>
                    <div class="position-desc">负责系统实施、客户培训、技术支持等工作</div>
                </div>
            </a>
            <a href="development-form.html" class="position-card">
                <div class="position-image development-bg">
                    💻
                </div>
                <div class="position-info">
                    <div class="position-name">开发岗位</div>
                    <div class="position-desc">负责软件开发、系统架构、技术研发等工作</div>
                </div>
            </a>
        </div>
        <!-- 删除个人信息按钮 -->
        <div style="width:100%;display:flex;justify-content:center;margin-top:2rem;">
          <button class="btn btn-danger" id="deleteInfoBtn" style="min-width:180px;height:44px;font-size:1.1rem;">删除个人信息</button>
        </div>
        <!-- 删除个人信息弹窗 -->
        <div id="deleteInfoModal" style="display:none;position:fixed;left:0;top:0;width:100vw;height:100vh;z-index:999;background:rgba(0,0,0,0.3);align-items:center;justify-content:center;">
          <div style="background:#fff;padding:2rem 2.5rem;border-radius:10px;box-shadow:0 4px 24px rgba(0,0,0,0.15);min-width:320px;max-width:90vw;display:flex;flex-direction:column;align-items:center;">
            <div style="margin-bottom:1rem;width:100%;display:flex;justify-content:center;">
              <label style="display:flex;align-items:center;">姓名：&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" id="deleteName" style="width:180px;margin-left:8px;" /></label>
            </div>
            <div style="margin-bottom:1.5rem;width:100%;display:flex;justify-content:center;">
              <label style="display:flex;align-items:center;">手机号：<input type="text" id="deletePhone" style="width:180px;margin-left:8px;" /></label>
            </div>
            <div style="text-align:center;width:100%;">
              &nbsp;&nbsp;&nbsp;<button class="btn" onclick="closeDeleteInfoModal()">取消</button>
              <button class="btn btn-danger" onclick="confirmDeleteInfo()" style="margin-left:12px;">确认删除</button>
            </div>
            <div id="deleteInfoMsg" style="color:#e74c3c;margin-top:1rem;display:none;text-align:center;width:100%;"></div>
          </div>
        </div>
        <script>
        // 页面加载时显示横幅
        window.onload = function() {
            showBanner();
        };

        // 访问公司官网
        function visitCompanyWebsite() {
            // 这里可以替换为您的实际官网地址
            const websiteUrl = 'https://www.license-solution.com/'; // 请替换为实际的公司官网地址
            
            // 在新标签页中打开官网
            window.open(websiteUrl, '_blank');
            
            // 横幅保持显示，不自动关闭
        }

        // 关闭横幅
        function closeBanner() {
            const banner = document.getElementById('companyBanner');
            if (banner) {
                banner.style.animation = 'slideUp 0.5s ease-out forwards';
                setTimeout(() => {
                    banner.style.display = 'none';
                    document.body.classList.remove('has-banner');
                }, 500);
            }
        }

        // 显示横幅（如果需要重新显示）
        function showBanner() {
            const banner = document.getElementById('companyBanner');
            if (banner) {
                banner.style.display = 'block';
                banner.style.animation = 'slideDown 0.5s ease-out';
                document.body.classList.add('has-banner');
            }
        }

        // 显示提示消息
        function showToast(message, type = 'info') {
            // 创建提示元素
            const toast = document.createElement('div');
            toast.className = `toast toast-${type}`;
            toast.textContent = message;
            toast.style.cssText = `
                position: fixed;
                top: 20px;
                right: 20px;
                background: ${type === 'success' ? '#27ae60' : type === 'error' ? '#e74c3c' : '#3498db'};
                color: white;
                padding: 12px 20px;
                border-radius: 6px;
                box-shadow: 0 4px 12px rgba(0,0,0,0.15);
                z-index: 10000;
                transform: translateX(100%);
                transition: transform 0.3s ease;
                font-size: 14px;
                font-weight: 500;
            `;
            
            // 添加到页面
            document.body.appendChild(toast);
            
            // 显示动画
            setTimeout(() => {
                toast.style.transform = 'translateX(0)';
            }, 100);
            
            // 3秒后自动移除
            setTimeout(() => {
                toast.style.transform = 'translateX(100%)';
                setTimeout(() => {
                    if (document.body.contains(toast)) {
                        document.body.removeChild(toast);
                    }
                }, 300);
            }, 3000);
        }

        document.getElementById('deleteInfoBtn').onclick = function() {
          document.getElementById('deleteInfoModal').style.display = 'flex';
          document.getElementById('deleteInfoMsg').style.display = 'none';
          document.getElementById('deleteName').value = '';
          document.getElementById('deletePhone').value = '';
        };
        function closeDeleteInfoModal() {
          document.getElementById('deleteInfoModal').style.display = 'none';
        }
        async function confirmDeleteInfo() {
          const name = document.getElementById('deleteName').value.trim();
          const phone = document.getElementById('deletePhone').value.trim();
          const msg = document.getElementById('deleteInfoMsg');
          msg.style.display = 'none';
          if (!name || !phone) {
            msg.textContent = '请填写姓名和手机号';
            msg.style.display = 'block';
            return;
          }
          try {
            const res = await fetch('/api/accounting/deleteByNameAndPhone', {
              method: 'POST',
              headers: {'Content-Type': 'application/json'},
              body: JSON.stringify({name, phone})
            });
            const result = await res.json();
            if (result.success) {
              msg.style.color = '#27ae60';
              msg.textContent = '删除成功';
              msg.style.display = 'block';
              setTimeout(() => {
                closeDeleteInfoModal();
              }, 1200);
            } else {
              msg.style.color = '#e74c3c';
              msg.textContent = result.message || '删除失败';
              msg.style.display = 'block';
            }
          } catch (e) {
            msg.style.color = '#e74c3c';
            msg.textContent = '网络错误，请重试';
            msg.style.display = 'block';
          }
        }
        </script>
    </main>
</body>
</html>